
/* Do file for "Why do Practitioners Want to Connect with Researchers? Evidence from a Field Experiment" */

gen efficient = 999
recode efficient 999=1 if EXP_GROUP==4
recode efficient 999=0 if (EXP_GROUP==1 | EXP_GROUP==2 | EXP_GROUP==3)

gen value_others = 999
recode value_others 999=1 if EXP_GROUP==3
recode value_others 999=0 if (EXP_GROUP==1 | EXP_GROUP==2 | EXP_GROUP==4)

gen more_info = 999
recode more_info 999=1 if EXP_GROUP==2
recode more_info 999=0 if (EXP_GROUP==1 | EXP_GROUP==3 | EXP_GROUP==4)

lab def EXP_GROUP 1 "Control" 2"More Details" 3"Value Others" 4"Efficient"
lab val EXP_GROUP EXP_GROUP


/* Comparisons from Figure 2 */
/* Control versus "efficiently share what you know" (group 4) */
prtest RESPONSE if (EXP_GROUP==1 | EXP_GROUP==4), by(EXP_GROUP)

/* Control versus "value others' expertise" (group 3)  */
prtest RESPONSE if (EXP_GROUP==1 | EXP_GROUP==3), by(EXP_GROUP)

/* Control versus "more information" (group 2)  */
prtest RESPONSE if (EXP_GROUP==1 | EXP_GROUP==2), by(EXP_GROUP)

/* balance check; appears in Appendix */
sort EXP_GROUP
by EXP_GROUP: sum FEMALE
oneway FEMALE EXP_GROUP, tabulate

by EXP_GROUP: sum SENATE
oneway SENATE EXP_GROUP, tabulate

by EXP_GROUP: sum HOUSE
oneway HOUSE EXP_GROUP, tabulate

/* Table 1 in main text */
logit RESPONSE more_info value_others efficient
test value_others=efficient
logit RESPONSE more_info value_others efficient SENATE HOUSE FEMALE

/* other comparisons mentioned in main text and appendix */
/* comparison between efficiency and valuing expertise treatments */
prtest RESPONSE if (EXP_GROUP==3 | EXP_GROUP==4), by(EXP_GROUP)

/* comparison between efficiency & valuing expertise treatments compared to more info treatment */
prtest RESPONSE if (EXP_GROUP==2 | EXP_GROUP==3), by(EXP_GROUP)
prtest RESPONSE if (EXP_GROUP==2 | EXP_GROUP==4), by(EXP_GROUP)

/* Figure 2 */
egen mean_RESPONSE = mean(RESPONSE), by(EXP_GROUP)
egen sd_RESPONSE = sd(RESPONSE), by(EXP_GROUP)
egen N_RESPONSE = count(RESPONSE), by(EXP_GROUP)

gen CI90 = invttail(N_RESPONSE-1,.05)*(sd_RESPONSE/sqrt(N_RESPONSE))
gen LB = mean_RESPONSE-CI90
gen UB = mean_RESPONSE+CI90
gen LB_se_RESPONSE = mean_RESPONSE-(sd_RESPONSE/sqrt(N_RESPONSE))
gen UB_se_RESPONSE = mean_RESPONSE+(sd_RESPONSE/sqrt(N_RESPONSE))

twoway (bar mean_RESPONSE EXP_GROUP, xlabel(1 2 3 4, valuelabel) barwidth(.5)) (rcap LB_se_RESPONSE UB_se_RESPONSE EXP_GROUP), legend(off) title("Proportion Choosing to Connect with Researchers") ytitle("") yscale(r(0(.05).25)) ylabel(0 "0" .05 ".05" .10 ".10" .15 ".15" .20 ".20" .25 ".25") graphregion(color(white)) scheme(s1mono) xtitle(" ")
graph export Figure_res.tif, replace height(2400) width(1600)

